package com.taotao.portal.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.taotao.portal.service.IndexService;

@Controller
public class IndexController {
	
	@Autowired
	private IndexService indexService;
	
	private Logger LOGGER = LoggerFactory.getLogger(IndexController.class);

	@RequestMapping(value="index",method=RequestMethod.GET)
	public ModelAndView showIndex(){
		ModelAndView mv = new ModelAndView("index");
		String ad = indexService.getIndexAd();
		mv.addObject("ad", ad);
		if(LOGGER.isDebugEnabled()){
			LOGGER.debug("展示首页");
		}
		return mv;
	}
//	@RequestMapping(value="item",method=RequestMethod.GET)
//	public String showIndex1(){
//		//ModelAndView mv = new ModelAndView("item");
//		if(LOGGER.isDebugEnabled()){
//			LOGGER.debug("展示item");
//		}
//		return "item";
//	}
//	@RequestMapping(value="index",method=RequestMethod.GET)
//	//@ResponseBody
//	public String showIndex(){
//		//ModelAndView mv = new ModelAndView("index");
//		return "index";
//	}
}
